package com.zhhs.jzcd.marketing.service.impl;

import java.util.List;
import com.zhhs.common.utils.DateUtils;
import com.zhhs.jzcd.channel.domain.BaseChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhhs.jzcd.marketing.mapper.BaseExactMarketingMapper;
import com.zhhs.jzcd.marketing.domain.BaseExactMarketing;
import com.zhhs.jzcd.marketing.service.IBaseExactMarketingService;

/**
 * 精准营销Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-03
 */
@Service
public class BaseExactMarketingServiceImpl implements IBaseExactMarketingService
{
    @Autowired
    private BaseExactMarketingMapper baseExactMarketingMapper;

    /**
     * 查询精准营销
     *
     * @param id 精准营销主键
     * @return 精准营销
     */
    @Override
    public BaseExactMarketing selectBaseExactMarketingById(Long id)
    {
        return baseExactMarketingMapper.selectBaseExactMarketingById(id);
    }

    /**
     * 查询精准营销列表
     *
     * @param baseExactMarketing 精准营销
     * @return 精准营销
     */
    @Override
    public List<BaseExactMarketing> selectBaseExactMarketingList(BaseExactMarketing baseExactMarketing)
    {
        return baseExactMarketingMapper.selectBaseExactMarketingList(baseExactMarketing);
    }

    /**
     * 新增精准营销
     *
     * @param baseExactMarketing 精准营销
     * @return 结果
     */
    @Override
    public int insertBaseExactMarketing(BaseExactMarketing baseExactMarketing)
    {
        baseExactMarketing.setCreateTime(DateUtils.getNowDate());
        return baseExactMarketingMapper.insertBaseExactMarketing(baseExactMarketing);
    }

    /**
     * 修改精准营销
     *
     * @param baseExactMarketing 精准营销
     * @return 结果
     */
    @Override
    public int updateBaseExactMarketing(BaseExactMarketing baseExactMarketing)
    {
        baseExactMarketing.setUpdateTime(DateUtils.getNowDate());
        return baseExactMarketingMapper.updateBaseExactMarketing(baseExactMarketing);
    }

    /**
     * 批量删除精准营销
     *
     * @param ids 需要删除的精准营销主键
     * @return 结果
     */
    @Override
    public int deleteBaseExactMarketingByIds(Long[] ids)
    {
        return baseExactMarketingMapper.deleteBaseExactMarketingByIds(ids);
    }

    /**
     * 删除精准营销信息
     *
     * @param id 精准营销主键
     * @return 结果
     */
    @Override
    public int deleteBaseExactMarketingById(Long id)
    {
        return baseExactMarketingMapper.deleteBaseExactMarketingById(id);
    }

    /**
     * 渠道类型下拉框
     */
    @Override
    public List<BaseChannel> getChannelType() {
        return baseExactMarketingMapper.getChannelType();
    }

    /**
     * 精准营销审核状态分类列表
     * @param status 精准营销状态
     * @return 结果
     */
    @Override
    public List<BaseExactMarketing> selectBaseExactMarketingListByStatus(String status)
    {
        return baseExactMarketingMapper.selectBaseExactMarketingListByStatus(status);
    }

}
